{% extends 'base.html'%}
{% block content %}

<p>Welcome to see fluctuations ,you can find all the fluctuations here</p>

{{s.stock_name}}

{{ fluctuation.id }}

 
<div id="left">


 <table>
 <tr>
<td>Date</td>
<td>    {{ fluctuation.date}}</td>
</tr>
<tr>
<td>Price</td>
<td>    {{ fluctuation.price }}</td>
</tr>
<tr>
<td>Volume</td>
<td>    {{ fluctuation.volume }}</td>
</tr>
<tr>
<td>Change</td>
<td>    {{ fluctuation.change }}</td>
</tr>
<tr>
<td>AverageDailyVolume</td>
<td>    {{ fluctuation.avg_daily_volume }}</td>
</tr>
<tr>
<td>StockExchange</td>
<td>    {{ fluctuation.stock_exchange }}</td>
</tr>
<tr>
<td>MarketCapital</td>
<td>    {{ fluctuation.market_cap }}</td>
</tr>
<tr>
<td>BookValue</td>
<td>    {{ fluctuation.book_value }}</td>
</tr>
<tr>
<td>E</td>
<td>    {{ fluctuation.ebitda }}</td>
</tr>
<tr>
<td>Dividend/perShare</td>
<td>    {{ fluctuation.dividend_per_share }}</td>
</tr>
<tr>
<td>DividendYield</td>
<td>    {{ fluctuation.dividend_yield }}</td>
</tr>
<tr>
<td>Earning/perShare</td>
<td>    {{ fluctuation.earnings_per_share }}</td>
</tr>
<tr>
<td>High/52weeks</td>
<td>    {{ fluctuation.week52_high }}</td>
</tr>
<tr>
<td>Low/52weeks</td>
<td>    {{ fluctuation.week52_low }}</td>
</tr>
<tr>
<td>Day50MovingAverage</td>
<td>    {{ fluctuation.day50_moving_avg }}</td>
</tr>
<tr>
<td>Day200MovingAverage</td>
<td>    {{ fluctuation.day200_moving_avg }}</td>
</tr>
<tr>
<td>PriceEarningRatio</td>
<td>    {{ fluctuation.price_earnings_ratio }}</td>
</tr>
<tr>
<td>PriceEarningGrowthRatio</td>
<td>    {{ fluctuation.price_earnings_growth_ratio }}</td>
</tr>
<tr>
<td>PriceSalesRatio</td>
<td>    {{ fluctuation.price_sales_ratio }}</td>
</tr>
<tr>
<td>PriceBookRatio</td>
<td>    {{ fluctuation.price_book_ratio }}</td>
</tr>
<tr>
<td>ShortRatio</td>
<td>    {{ fluctuation.short_ratio }}</td>
</table> 
</div>

	  <div id="right">

<!-- Start of Yahoo! Finance code -->
<iframe allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://api.finance.yahoo.com/instrument/1.0/{{s.stock_name}}/badge;chart=1d;quote/HTML?AppID=b3akuDOAR3rFathoBUrfM0mg4GHr&sig=t9J3T_Oes.BhB5iRUtQ.sD_ZylQ-&t=1249487289335" width="200px" height="513px"><a href="http://finance.yahoo.com">Yahoo! Finance</a><br/><a href="http://finance.yahoo.com/q?s={{s.stock_name}}/">Quote for {{s.stock_name}}/</a></iframe>
<!-- End of Yahoo! Finance code -->
      </div>
 
{% if user.is_authenticated %}

          <table >

      <tr><th>User</th><th>Recommendation</th><th>Text</th></tr>
                                
                                {% for rec in rec %}
                                
                                <tr>
                                <td>{{rec.user}}</td>
                                <td>{{rec.type}}</td>
                                <td>{{rec.text}}</td>
                                
                                
         {%ifnotequal has_rated.user rec.user%}
                                <td>    <a href="/recommendation/fluctrecrating/{{ s.stock_name }}/{{rec.id}}"? rel='lyteframe' title='Now viewing request' rev='width: 900px; height: 900px; scrolling: no;'>Rating</a></td>
                 {%endifnotequal%}
                                
                                </tr>
                                {% endfor %}
                                </table>

          {% if has_rated %}
                                already voted: User {{ has_rated.user }},
                               recommend to {{ has_rated.type }},
                                {{ has_rated.text }} for fluctuation of {{s.stock_name}}
                                on {{ fluctuation.date}}

                                 
                  {% else %}
                   <form action="" method="POST">
              {{ form.as_p }}
               <input type="submit" name="submit" value="Submit" />
               </form>
             {% endif %}
             <p><td><a href="/personalstock/trade/{{ s.stock_name }}">trade</a></td></p>
{%else%}
	<p>you can login to make recommendation</p>
	<a href="/users/login/"  class="current"><b onmouseout="this.style.color = 'black';" onmouseover="this.style.color = '#0BB359';" align="justify">Login</b></a>
             
{% endif %}


{%endblock%}
                  

